<%-- 
    Document   : add_student_post
    Created on : Nov 24, 2011, 8:18:50 PM
    Author     : THIENSUHACK
--%>

<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="GetData.DataWS"%>
<%@page import="dktc_ws.Lophoc"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    Lophoc lop = new Lophoc();
    lop.setMaLop(Integer.parseInt(request.getParameter("malop")));
    lop.setMagv(Integer.parseInt(request.getParameter("magiangvien")));
    lop.setMamh(request.getParameter("mamonhoc"));
    lop.setMahk(Integer.parseInt(request.getParameter("mahocky")));
    lop.setSoluongdktoda(Integer.parseInt(request.getParameter("sisotoida")));
    lop.setThu(Short.parseShort(request.getParameter("thu")));
    lop.setCa(Short.parseShort(request.getParameter("ca")));
    int sophongcu = Integer.parseInt(request.getParameter("sophongcu"));
    int sophongmoi = Integer.parseInt(request.getParameter("sophong"));

    int result=0;
    DataWS a=new DataWS();
   
   result=a.sualophoc(lop.getMaLop(), lop.getMamh(), lop.getMagv(), lop.getSoluongdktoda(),lop.getMahk(),lop.getThu(),lop.getCa());
   if (sophongmoi != sophongcu)
             {
                    a.xoaCTPhong(sophongcu, lop.getMaLop());
                    result = a.themCTPhong(sophongmoi, lop.getMaLop());
             }
   if(result>0)
             {
       out.print("thanh cong");
   }
   else
       out.print("that bai");
           %>